package com.muki.repository;

import java.io.Serializable;

import org.apache.log4j.Logger;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.repository.query.MongoEntityInformation;
import org.springframework.data.mongodb.repository.support.SimpleMongoRepository;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public class SimpleMongoRepositoryImpl<T,ID extends Serializable> extends SimpleMongoRepository<T, ID> {

	private Logger log = Logger.getLogger(this.getClass());
	private final MongoOperations mongoTemplate;
	private final MongoEntityInformation<T, ID> entityInformation;
	
	
	public SimpleMongoRepositoryImpl(MongoEntityInformation<T, ID> metadata, MongoOperations mongoOperations) {
		super(metadata, mongoOperations);
		this.entityInformation = metadata;
		this.mongoTemplate = mongoOperations;
	}
	
	protected Class<T> getEntityClass() {
		return entityInformation.getJavaType();
	}

}
